package com.myhome.money.activemq.moneyactivemq.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.jms.Queue;

/**
 * @author 许路路
 */
@RestController
public class HomeController {

    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;

    @Autowired
    private Queue queue;

    @RequestMapping("index")
    public String index() {
        String msg = "3456788";
        jmsMessagingTemplate.convertAndSend(queue, msg);
        return "123456789";
    }

}
